Casper CBC: CasperLabs implementation
https://github.com/CasperLabs/CasperLabs
createBlock
https://github.com/CasperLabs/CasperLabs/blob/1c64dcede573d7a0a7569e6b275291e2a9dd5cbe/casper/src/main/scala/io/casperlabs/casper/MultiParentCasperImpl.scala#L252
validate block
code: Validate.scala
for {
_ <- Validate.blockHashF(block)
_ <- Validate.deployCountF(block)
_ <- Validate.missingBlocksF(block, dag)
_ <- Validate.timestampF(block, dag)
_ <- Validate.repeatDeployF(block, dag)
_ <- Validate.blockNumberF(block)
_ <- Validate.justificationFollowsF(block, genesis, dag)
_ <- Validate.parentsF(block, genesis, lastFinalizedBlockHash, dag)
- <- Validate.sequenceNumberF(block, dag)
- <- Validate.justificationRegressionsF(block, genesis, dag)
_ <- Validate.shardIdentifierF(block, shardId)
} yield ()
blockHash
check that blockHash matches the calculated block hash
deployCount
timestamp
repeatDeploy
missingBlocks
blockNumber
justificationFollows
parents
sequenceNumber
justificationRegressions
sharedIdentifier
#CasperLabs #Casper